public class Test1 {
    public static void main(String[] args) {
        try{
            new A().func();
        }catch (NameException e){
            e.printStackTrace();
            System.out.println("名字处理错误异常");
        }finally{
            System.out.println("finally");
        }



    }

}


class A{
    void func() throws NameException{
        throw new NameException("名字错误");
    }

}
